﻿using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Ebusiness_PaymentService.Services;
using Ebusiness_PaymentService.Services.Dtos.OrderPayment;

namespace Ebusiness_PaymentService.Controllers;


[Route("OrderPayment")]
[ApiController]
public class OrderPaymentController : AbpController
{
    public IOrderPaymentService orderPaymentService { get; set; }

    public OrderPaymentController()
    {

    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="productDto"></param>
    /// <returns></returns>
    [HttpPost]
    public async Task<OrderPaymentDto> Create(OrderPaymentDto productDto)
    {
        var dto = await orderPaymentService.CreateAsync(productDto);
        return dto;
    }

    /// <summary>
    /// 获取列表数据
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public async Task<List<OrderPaymentDto>> GetList()
    {
        var dtos = await orderPaymentService.GetListAsync(new PagedAndSortedResultRequestDto() { MaxResultCount = 50, SkipCount = 0 });
        return dtos.Items.ToList();
    }
}
